/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "stateprovince")
@NamedQueries({
    @NamedQuery(name = "Stateprovince.findAll", query = "SELECT s FROM Stateprovince s"),
    @NamedQuery(name = "Stateprovince.findByIdstateprovince", query = "SELECT s FROM Stateprovince s WHERE s.idstateprovince = :idstateprovince"),
    @NamedQuery(name = "Stateprovince.findByStateprovince", query = "SELECT s FROM Stateprovince s WHERE s.stateprovince = :stateprovince")})
public class Stateprovince implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idstateprovince")
    private Integer idstateprovince;
    @Basic(optional = false)
    @Column(name = "stateprovince")
    private String stateprovince;
    @OneToMany(mappedBy = "stateprovince", fetch = FetchType.LAZY)
    private List<Localityelement> localityelementList;

    public Stateprovince() {
    }

    public Stateprovince(Integer idstateprovince) {
        this.idstateprovince = idstateprovince;
    }

    public Stateprovince(Integer idstateprovince, String stateprovince) {
        this.idstateprovince = idstateprovince;
        this.stateprovince = stateprovince;
    }

    public Integer getIdstateprovince() {
        return idstateprovince;
    }

    public void setIdstateprovince(Integer idstateprovince) {
        this.idstateprovince = idstateprovince;
    }

    public String getStateprovince() {
        return stateprovince;
    }

    public void setStateprovince(String stateprovince) {
        this.stateprovince = stateprovince;
    }

    public List<Localityelement> getLocalityelementList() {
        return localityelementList;
    }

    public void setLocalityelementList(List<Localityelement> localityelementList) {
        this.localityelementList = localityelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idstateprovince != null ? idstateprovince.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Stateprovince)) {
            return false;
        }
        Stateprovince other = (Stateprovince) object;
        if ((this.idstateprovince == null && other.idstateprovince != null) || (this.idstateprovince != null && !this.idstateprovince.equals(other.idstateprovince))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Stateprovince[idstateprovince=" + idstateprovince + "]";
    }

}
